<%@ include file="/WEB-INF/jsp/common/include.jsp" %>
<%@ page pageEncoding="UTF-8"%>
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %>
<tiles:insertDefinition name="adminLayout.tiles">
  <tiles:putAttribute name="pageTitle">ad</tiles:putAttribute>
  <tiles:putAttribute name="adminAdTab" cascade="true">selected</tiles:putAttribute>
  <tiles:putAttribute name="body" cascade="true">
    <style type="text/css">
      @import url("/css/admin.css");
    </style>
    <div class="block padding">
      <table class="addImportWorflow">
        <tbody>
          <tr>
            <td>
            </td>
            <td>
              <div>
                <a href="/admin/ad/crawl/blingBy.do">Crawl</a> data from bling.by to <code>FlatCrawledAd</code> table.
              </div>
              <img src="/image/arrow-down.png"/>
            </td>
            <td>
            </td>
          </tr>
        </tbody>
        <tbody class="chain">
          <tr>
            <td colspan="3">
              <jsp:include page="batch-item.jsp">
                <jsp:param name="batchUrl" value="/admin/ad/transform.do"/>
                <jsp:param name="queueSizeUrl" value="/admin/ad/queueSize/transform.do"/>
                <jsp:param name="batchText" value="Transform some ads from FlatCrawledAd table to FlatAd table.
                Ensure that FlatAd table has no duplicates. Remove transformed FlatCrawledAds table."/>
              </jsp:include>
            </td>
          </tr>
          <tr>
            <td colspan="3">
              <jsp:include page="batch-item.jsp">
                <jsp:param name="batchUrl" value="/admin/ad/proccess/agent.do"/>
                <jsp:param name="queueSizeUrl" value="/admin/ad/proccess/queueSize/agent.do"/>
                <jsp:param name="batchText" value="Detect agents for FlatAds based ad count published from phone"/>
              </jsp:include>
            </td>
          </tr>
          <tr>
            <td colspan="3">
              <jsp:include page="batch-item.jsp">
                <jsp:param name="batchUrl" value="/admin/ad/proccess/rating.do"/>
                <jsp:param name="queueSizeUrl" value="/admin/ad/proccess/queueSize/rating.do"/>
                <jsp:param name="batchText" value="Calculate rating for FlatAds based on publishing date."/>
              </jsp:include>
            </td>
          </tr>
          <tr>
            <td colspan="3">
              <jsp:include page="batch-item.jsp">
                <jsp:param name="batchUrl" value="/admin/ad/proccess/geoLocation.do"/>
                <jsp:param name="queueSizeUrl" value="/admin/ad/proccess/queueSize/geoLocation.do"/>
                <jsp:param name="batchText" value="Assign latitude and longitude to some FlatAds using Building table."/>
              </jsp:include>
            </td>
          </tr>
          <tr>
            <td colspan="3">
              <jsp:include page="batch-item.jsp">
                <jsp:param name="batchUrl" value="/admin/ad/proccess/distance.do"/>
                <jsp:param name="queueSizeUrl" value="/admin/ad/proccess/queueSize/distance.do"/>
                <jsp:param name="batchText" value="Precalculate distances for check points and store this information to FlatAd table.
                This information will be used for searching (sorting) by location."/>
              </jsp:include>
            </td>
          </tr>
          <tr>
            <td colspan="3">
              <div>
                <a href="/admin/ad/proccess/old.do">Delete</a> old flat ads.
              </div>
              <img src="/image/arrow-down.png"/>
            </td>
          </tr>
          <tr>
            <td colspan="3">
              <div>
                <a href="/admin/ad/proccess/oldImage.do">Delete</a> old flat images.
              </div>
              <img src="/image/arrow-down.png"/>
            </td>
          </tr>
          <tr>
            <td colspan="3">
              <div>
                <a href="/admin/ad/proccess/oldPublisher.do">Delete</a> information about old ad publishers.
              </div>
            </td>
          </tr>
        </tbody>
      </table>
    </div>
    <br>
    <div class="block padding">
      <p>
        <a href="/admin/ad/deleteAll.do">Delete</a> all flat ads. This breaks agent calculation.
      </p>
    </div>
  </tiles:putAttribute>
</tiles:insertDefinition>